import Vue from 'vue'
import Router from 'vue-router'
import HelloWorld from '@/components/HelloWorld'
import login from '@/components/login'
import Welcome from '@/components/Welcome'
import Register from '@/components/Register'
import BookList from '@/components/BookList'
import mainPage from '@/components/mainPage'
import formPage from '@/components/formPage'

Vue.use(Router)

export default new Router({
  routes: [
    {
      path: '/form',
      name: 'formPage',
      component: formPage
    },
    {
      path: '/mainPage',
      name: 'mainPage',
      component: mainPage,
      children: [{
        path: 'bookList',
        component: BookList
      }]
    },
    {
      path: '/bookList',
      name: 'bookList',
      component: BookList
    },
    {
      path: '/',
      name: 'HelloWorld',
      component: HelloWorld
    },
    {
      path: '/login/:uName',
      name: 'login',
      component: login
    },
    {
      path: '/welcome',
      name: 'welcome',
      component: Welcome
    },
    {
      path: '/register',
      name: 'register',
      component: Register
    }
  ]
})
